1. Field of the Invention
The present invention relates to a file managing method of an information recording medium and, more particularly, to a file managing method when data is added to a file of an information recording medium in which erasing and rewriting operations cannot be performed.
2. Related Background Art
Hitherto, as information recording media, a floppy disk in which the recording and reproducing operations are executed by using magnetism, an optical information recording medium in which the recording and reproducing operations are executed by using a light, and the like have been known. As forms of the optical information recording media, various kinds of forms such as disc form, card form, tape form, and the like have been known. Among such optical information recording media, a card-shaped optical information recording medium (hereinafter, referred to as an optical card) is a medium in which a large demand is expected as a portable information recording medium of a relatively large capacity whose size and weight are small. The information recording media are mainly classified into a medium of the type in which the erasing and rewriting operations can be performed and a medium of the type in which the erasing and rewriting operations cannot be executed due to the characteristics of the medium. However, the erasing and rewriting operations of the optical card are generally impossible. Advantages in the application of the optical card to a field such as a medical field or the like are expected since the rewriting operation cannot be performed results.
Generally, auxiliary data to manage data on a block unit basis in order to store a large capacity of data, namely, what is called a directory is used in an information recording medium. File information such as file name of a file to be managed by the directory, file length, leading data track number, and the like are ordinarily written into the directory, thereby executing a file management of the data section. The optical card, particularly, the optical card in which the erasing and rewriting operations are impossible, has a large recording capacity although its size is similar to the size of a credit card. To manage information of such a large capacity, a managing method of information by use of the directory is needed.
FIG. 1 is a schematic plan view showing an example of an optical card. In FIG. 1, an optical card 1 has a data section 10 (10.sub.1, 10.sub.2, . . . , 10.sub.n) comprising data tracks and a directory section 20 (20.sub.1, 20.sub.2, . . . , 20.sub.n). Data is written into the data section 10 in the direction indicated by an arrow E from the upper portion of the optical card. Directory information as data management information is written into the directory section 20 in the direction indicated by an arrow D from the lower portion of the optical card 1.
On the other hand, to manage data as a file, map information indicative of storage information of the file is also necessary in addition to the directory information as identification information to distinguish the file from another file. That is, there is needed information indicating from which track on the information recording medium the file is started, from which sector among sectors of several units obtained by dividing the track the file is started, or from which cluster as a management unit obtained by combining a plurality of sectors the file is started, and also indicating on which track (hereinafter, in the specification, explanation will be made on the assumption that the minimum recording unit and the management unit are set to one track) the files have been arranged in which order. Generally, such map information is called a file allocation table (FAT).
FIG. 2 is a diagram for explaining the concept of the FAT. In FIG. 2, regions 1, 2, . . . , N (generally, about 2500 regions) corresponding to the data tracks on the optical card are prepared for the FAT. The number of track track on which the information subsequent to the information recorded on the track has been recorded is recorded in each region. For instance, in FIG. 2, the file starting from the region 1 continues to the regions 2 and 4. The file starting from the region continues to the regions 5, 6, and 7. In FIG. 2, "FF" written in the region denotes that the file doesn't have any file to be continued, that is, "FF" indicates the last track of the file. "0" indicates that the track is an unused (no data is recorded) track. By using both the directory and the FAT, the ID information such as a file name and the like and the leading track number can be known from the directory and the storage information can be known from the FAT, respectively, so that a file management can be efficiently executed.
When considering an FAT to manage the files on a track unit basis, in order to record the FAT onto the optical card, assuming that the maximum track No. is set to 2500, 12 bits are needed for one region in FIG. 2 and 2500 regions are necessary. Thus, a capacity of (12 bits.times.2500)=30000 bits=3750 bytes are needed. For instance, assuming that a capacity of one track is set to 512 bytes, such a capacity of 3750 bytes corresponds to a capacity of about 7.3 tracks.
In the case of an erasable and rewritable medium, for the regions of the FAT, a predetermined region is prepared on the medium and in the case where there is a change in storage information as a result of a new file being recorded or the file being updated, it is sufficient to rewrite the content in such the predetermined region with the latest information. In the case of a medium such as an optical card in which the erasing and rewriting operations are impossible, however, each time there is a change in storage information, it is necessary to additionally record a new FAT. For instance, each time a new file is added, the information recording capacity of eight tracks is used as an FAT in the above example. Assuming that the total number of tracks is set to 2500 as in the above example, even if all of the tracks are allocated to an FAT, only changes in the storage information of about 300 times (2500/8=ABT. 312) can be permitted. Actually, since the data and directories are recorded, the number of tracks which are allocated to the FAT is further reduced. On the contrary, even if there are several changes in storage information at a time (for an interval from a point of time when the optical card has been inserted into the recording and reproducing apparatus until a point of time when it is ejected out), for instance, it is sufficient to record the FAT only once before the optical card is ejected out. Therefore, the above numerical value of about 300 times is merely a target value and the actual number of change times is not so largely deviated from the above value. In other words, a point that the FAT is recorded onto the optical card in which the erasing and rewritting operations are impossible causes a problem such that the information capacity of the optical card cannot be effectively used.
To solve the above problem, it is not permitted to record data onto the track at random but it is permitted only to sequentially record data. In other words, the recording of a new file is certainly started from the next track of the last recording track at that time point and the data is sequentially recorded onto the subsequent tracks. With this method, the above problem can be solved. In this case, the first track number and the size (the number of tracks used) of file can be known from the directory information and the continuance of the information certainly exists on the next track. Therefore, even if the FAT is not recorded onto the optical card, the FAT can be constructed from the directory information.
On the other hand, as a method of adding (appending) data into the file on an information recording medium in which the erasing and rewritting operations are impossible, the applicant of the present invention has proposed a method using an appending-flag in JP-A-1-258288. That is, a flag (appending-flag) indicative of the addition of file data is provided in the directory. When data is added into the existing file, the data to be added is recorded as another file. The directory to manage the additional data file (partial file) is recorded into the directory section by incrementing the appending-flag, thereby considering that the files whose names are the same and whose appending-flags differ can be regarded as one file which has divisionally been recorded in accordance with the order of the numbers of the appending-flags.
FIG. 3 is a diagram for explaining the addition of data into the file by using the appending-flags and simulates a data section. In FIG. 3, A and B denote file names and a numerical value in the parentheses indicates an appending-flag. For instance, reference numeral 201 indicates the first data (partial file) in the file A. Similarly, reference numeral 202 indicates the first data in the file B and 203 denotes the next data in the file A, that is, the data added to A(1). Although not shown in FIG. 3, the directory which manages each partial file has been recorded in the directory section. In FIG. 3, A(1) occupies the tracks 1 to m, B(1) occupies the tracks (m+1) to (n-1), and A(2) occupies the tracks (n) to (k).
Assuming that data is recorded on a track unit basis, a size of the file is not always integer times as large as a capacity of one track. Therefore, for instance, like the tracks (m) and (k) in FIG. 3, invalid data sections 204 and 205 generally exist on the last track of each file. When considering that the files A(1) and A(2) are combined and are regarded as one continuous logical file A, as a theoretical file structure, the first portion of the file A(2) should exist in the invalid data section 204 and such a conversion needs to be executed. For this purpose, for instance, in the case of reading out the data on a byte unit basis, subsequent to the last valid byte of the track (m), the first byte of the track (n) needs to be read out, resulting in a problem that the processes become complicated. Since the data reproduction is executed every track, a time required for the reproduction of one track is the same irrespective of the presence or absence of the invalid data section in one track. There is also a problem such that as the number of adding times increases, a vain time accordingly increases and it takes a long time for reproduction. The above problem is typical particularly in the case where a capacity of the file to be added and the data to be added is so small to be a fraction of the data capacity in one track. For instance, assuming that the file size is equal to 1/5 of one track, since one track is necessary for one addition, if the adding process is executed four times, the contents of all of the files corresponding to the recording capacity (1/5.times.5=1) of one track can be actually reproduced only by reproducing five tracks including the first file.
The invention is made to solve the above problems and it is an object of the invention to provide a file managing method which can efficiently manage files.